home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 51 / Amiga Format CD51 (2000-03-10)(Future Publishing)(GB)[!][issue 2000-04].iso / -in_the_mag- / workbench / term_4.8 / extras / source / gtlayout-source.lha / Assert.h < prev    next >
C/C++ Source or Header  |  1997-07-06  |  2KB  |  57 lines

  1. /*
  2. **    $Id: Assert.h 42.1 1997/07/06 09:01:09 olsen Exp olsen $
  3. **
  4. **    :ts=8
  5. */
  6.  
  7. /* WICHTIG: Wenn DEBUG definiert wird, darf es *NUR* hier geschehen.
  8.  *          Damit wird im smakefile eine Regel genutzt, die alle von
  9.  *          den Auswirkung der Ă„nderungen an dieser Definition
  10.  *          betroffenen Module neu erzeugt.
  11.  */
  12.  
  13. /*#define DEBUG*/
  14.  
  15. /****************************************************************************/
  16.  
  17. #ifdef ASSERT
  18. #undef ASSERT
  19. #endif    /* ASSERT */
  20.  
  21. #ifdef DEBUG
  22. void _ASSERT(int x,const char *xs,const char *file,int line,const char *function);
  23. void _SHOWVALUE(unsigned long value,int size,const char *name,const char *file,int line);
  24. void _SHOWSTRING(const char *string,const char *name,const char *file,int line);
  25. void _SHOWMSG(const char *msg,const char *file,int line);
  26. void _ENTER(const char *file,int line,const char *function);
  27. void _LEAVE(const char *file,int line,const char *function);
  28. void _RETURN(const char *file,int line,const char *function,unsigned long result);
  29.  
  30. #ifdef __SASC
  31. #define ASSERT(x)    _ASSERT((int)(x),#x,__FILE__,__LINE__,__FUNC__);
  32. #define ENTER()        _ENTER(__FILE__,__LINE__,__FUNC__)
  33. #define LEAVE()        _LEAVE(__FILE__,__LINE__,__FUNC__)
  34. #define RETURN(r)    _RETURN(__FILE__,__LINE__,__FUNC__,(unsigned long)r)
  35. #else
  36. #define ASSERT(x)    _ASSERT((int)(x),#x,__FILE__,__LINE__,"unknown_function");
  37. #define ENTER()        ((void)0)
  38. #define LEAVE()        ((void)0)
  39. #define RETURN(r)    ((void)0)
  40. #endif    /* __SASC */
  41.  
  42. #define SHOWVALUE(v)    _SHOWVALUE((unsigned long)(v),sizeof(v),#v,__FILE__,__LINE__);
  43. #define SHOWSTRING(s)    _SHOWSTRING((const char *)(s),#s,__FILE__,__LINE__);
  44. #define SHOWMSG(s)    _SHOWMSG((const char *)(s),__FILE__,__LINE__);
  45.  
  46. #else
  47.  
  48. #define ASSERT(ignore)        ((void)0)
  49. #define SHOWVALUE(ignore)    ((void)0)
  50. #define SHOWSTRING(ignore)    ((void)0)
  51. #define SHOWMSG(ignore)        ((void)0)
  52. #define ENTER()            ((void)0)
  53. #define LEAVE()            ((void)0)
  54. #define RETURN(r)        ((void)0)
  55.  
  56. #endif    /* DEBUG */
  57.